package com.own.business.question.entity.map;

import com.own.business.question.entity.po.QuestionOption;
import com.own.component.common.base.entity.BaseMap;
import com.own.constant.ConstantBeanSuffix;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.NonNull;
import lombok.Setter;
import lombok.ToString;
import lombok.experimental.Accessors;

/**
 * QuestionOptionMapVo
 *
 * @author chenxueli
 * @date 2021/05/14 09:41:05
 */
@Schema(description = "题目选项" + ConstantBeanSuffix.MAP_VO)
@Getter
@Setter
@ToString
@Accessors(chain = true)
@AllArgsConstructor
@NoArgsConstructor
public class QuestionOptionMapVo extends BaseMap<QuestionOption> {

    @Schema(description = "题目id")
    private Long questionId;

    @Schema(description = "文字内容")
    private String content;

    @Schema(description = "图片文件id")
    private String image;

    @Schema(description = "选择题的时候是否为正确的答案 1-是 0不是")
    private Integer isAnswer;

    /**
     * 构造方法
     *
     * @param entity 原对象
     */
    public QuestionOptionMapVo(@NonNull QuestionOption entity) {
        super(entity);
        this.questionId = entity.getFkQuestionId();
        this.content = entity.getContent();
        this.image = entity.getImage();
        this.isAnswer = entity.getIsAnswer();
    }
}
